package designPattern.factory.abstractfactory.store;

import designPattern.factory.abstractfactory.factory.ChicagoPizzaIngredientFactory;
import designPattern.factory.abstractfactory.factory.NYPizzaIngredientFactory;
import designPattern.factory.abstractfactory.factory.PizzaIngredientFactory;
import designPattern.factory.abstractfactory.pizza.CheesePizza;
import designPattern.factory.abstractfactory.pizza.PepperPizza;
import designPattern.factory.abstractfactory.pizza.Pizza;

public class ChicagoStylePizzaStore extends PizzaStore {
    @Override
    Pizza creatPizza(String type) {
        Pizza pizza = null;
        PizzaIngredientFactory ingredientFactory = new ChicagoPizzaIngredientFactory();
        if (type.equals("cheese")) {
            pizza = new CheesePizza(ingredientFactory);
        } else if (type.equals("pepper")) {
            pizza = new PepperPizza(ingredientFactory);
        }
        return pizza;
    }
}
